package biz.ezcom.design.pattern.state;

/**
 * 晚上的状态
 */
public class StateEvening implements State {

	@Override
	public void handle(Context context) {
		int hour = context.getHour();
		if(hour > 18 || hour <= 8 ){
			System.out.println(hour + "：休息中");
		}else{
			context.setState(new StateMorning());
			context.request();
		}
	}

}
